<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('审批请假')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-level-edit" th:object="${level}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">请假人：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input style="width: 150px" name="dateStart" th:field="*{userName}" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请假日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input style="width: 150px" name="dateStart" th:field="*{dateStart}" class="form-control" type="text" disabled>
                        <span> &nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; </span>
                        <input style="width: 150px;float: right" name="dateEnd" th:field="*{dateEnd}"  class="form-control" type="text" disabled>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请假原因：</label>
                <div class="col-sm-8">
                    <textarea name="reason" class="form-control" readonly>[[*{reason}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">审批结果：</label>
                <div class="col-sm-3 is-refresh">
                    <div class="radio-box">
                        <input type="radio" id="refresh-no" name="result" value="0" checked>
                        <label for="refresh-no">不同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" id="refresh-yes" name="result" value="1">
                        <label for="refresh-yes">同意</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">审批意见：</label>
                <div class="col-sm-8">
                    <textarea name="approvalReason" class="form-control"></textarea>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/level";
        $("#form-level-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/shenpi", $('#form-level-edit').serialize());
            }
        }

        $("input[name='dateStart']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='dateEnd']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='approvalDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>